package cn.bitkit.tools.data;

import cn.bitkit.base.util.StringUtil;

public class VersionUtil {
	
	public static boolean isLower(String target, String current) {
		String[] targetArray = target.trim().replaceAll("[a-zA-z]", "").split("\\.");
		String[] currentArray = current.trim().replaceAll("[a-zA-z]", "").split("\\.");
		for(int i=0; i<targetArray.length; i++) {
			if(currentArray.length < i+1) {
				return true;
			}
			String targetValue = targetArray[i];
			String currentValue = currentArray[i];
			if(StringUtil.toLong(currentValue) < StringUtil.toLong(targetValue)) {
				return true;
			}
		}
		return false;
	}

}
